package cn.star.jots.filmRating.controller;

import cn.star.jots.base.response.JsonResult;
import cn.star.jots.filmRating.pojo.vo.FilmRatingVO;
import cn.star.jots.filmRating.service.FilmRatingService;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/v1/filmRating")
@Api(tags = "电影评分")
@Slf4j
public class FilmRatingController {

    @Autowired
    FilmRatingService filmRatingService;

    @GetMapping("/select/topTen")
    @ApiOperation(value = "查询电影评分信息")
    public JsonResult selectFilmRating() {
       log.info("查询电影评分信息");
       List<FilmRatingVO> list = filmRatingService.selectFilmRating();
       return JsonResult.ok(list);
    }

    @GetMapping("/select/hit")
    @ApiOperation(value = "查询热播电影")
    public JsonResult selectHit() {
        log.info("查询热播电影");
        List<FilmRatingVO> list = filmRatingService.selectHitFilm();
        return JsonResult.ok(list);
    }

}
